package com.fantasy.demo1.config;


import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Configuration;

/**
 * 生命周期配置
 */
@Configuration
public class MyConfiguration implements InitializingBean, DisposableBean {

    public MyConfiguration() {
        System.out.println("构造方法被调用");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy方法被调用");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet方法被调用");
    }
}
